<?php
class Admin_Model_Categories extends Zend_Db_Table{
	protected $_name = 'categories';
	protected $_primary = 'category_id';
	////////////
	/* select*/
	//////////
	//1-product , 2-new , 3-qa
	public function selectCateByType($type)
	{// co dung
		$client = new Zend_Rest_Client(HTTP_SERVICE);
		$return = $client->restGet("/categories/route/selectCateByType/type/".$type);
		$return = json_decode(json_encode((array) simplexml_load_string($return->getBody())),1);

		for ($i=0;$i <count($return);$i++)
				$data[$i] = $return['row_'.$i];
				
		return $data;
	}
}